package com.atguigu.lease.common.minio;

import io.minio.MinioClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @ClassName MinIoClient
 * @Author heartFade
 * @Date 2025-05-02 15:04
 * @Version 1.0
 * @Description TODO
 **/
@Configuration
@EnableConfigurationProperties(MinIoClientProperties.class)
public class MyMinIoClient {
    @Autowired
    MinIoClientProperties minIoClientProperties;

    @Bean
    public MinioClient getMinIoClient()
    {
        MinioClient build = MinioClient.builder().credentials(minIoClientProperties.getAccessKey(),
                minIoClientProperties.getAccessSecret()).endpoint(minIoClientProperties.getEndPoint()).build();
        return build;
    }
}
